﻿@model VideoCache.Server.MVCWeb.Areas.Admin.Models.FormTestModel
@{
    ViewBag.Title = "Index";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}
<h2>
    Index</h2>
<script src="@Url.Content("~/Scripts/jquery.form.js")" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $.post("@Url.Action("LoadData")", "json", function(data) { fillForm(data) });
        $("#Form1").submit(function(){
            $("input[type='submit']").attr("disabled", "disabled");
            var data = $("#Form1").serialize();
            
            $("input[type='submit']").removeAttr("disabled");
            return false;
        });
    });
</script>
<form method="post" action="Index" id="Form1">
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>FormTestModel</legend>
        <div class="editor-label">
            @Html.LabelFor(model => model.UserName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.UserName)
            @Html.ValidationMessageFor(model => model.UserName)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Password)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Password)
            @Html.ValidationMessageFor(model => model.Password)
        </div>
        <p>
            <input type="submit" value="提交" />
        </p>
    </fieldset>
</form>
<div>
    @Html.ActionLink("Back to List", "Index")
</div>
